const resizeCallBack = [];
const charts1 = {};
(function () {
    function setFont() {
        console.log('重新设置大小');
        let width = window.innerWidth;
        if (width < 1285) {
            width = 1285;
        }
        let htmlHtmlElement = document.querySelector('html');
        let number = width / 80;
        htmlHtmlElement.style.fontSize = number + 'px';
        setTimeout(() => {
            resizeCallBack.forEach(i => {
                if (i.chart) {
                    i.chart.setOption(i.fontChange(number));
                    i.chart.resize();
                } else {
                    i.resize();
                }
            })
        }, 500);
    }

    setFont();
    let f = null;
    window.onresize = function () {
        if (f != null) {
            clearTimeout(f);
        }
        f = setTimeout(setFont, 500);
    };
})();